
package Display;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.*;

public class ParentDisplay extends JPanel implements ActionListener {
	private ToolBar toolBar;
	private FunctionButtons functionButtons;
	private ContentsDisplay contentsDisplay;
	
	public ParentDisplay() {
		setLayout(new BorderLayout(9, 22));
		
		toolBar = new ToolBar();
		functionButtons = new FunctionButtons();
		contentsDisplay = new ContentsDisplay();
		
		add(toolBar, BorderLayout.NORTH);
		add(functionButtons, BorderLayout.WEST);
		add(contentsDisplay, BorderLayout.CENTER);
	}
	
	public ParentDisplay(ContentsDisplay _contentsDisplay) {
		setLayout(new BorderLayout(9, 22));
		
		toolBar = new ToolBar();
		functionButtons = new FunctionButtons();
		contentsDisplay = new ContentsDisplay();
		this.contentsDisplay = _contentsDisplay;
		
		add(toolBar, BorderLayout.NORTH);
		add(functionButtons, BorderLayout.WEST);
		add(contentsDisplay, BorderLayout.CENTER);
	}
	
	public void setParentDisplay(ContentsDisplay _contentsDisplay) {
		this.contentsDisplay = _contentsDisplay;
	}

	public void getAction() {
		// TODO Auto-generated method stub
		String str = functionButtons.getActionEvent();
		
		if (str.equals("buttonDisplay")) {
			System.exit(1);
		}
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		// TODO Auto-generated method stub
		String str = functionButtons.getActionEvent();
		
		if (str.equals("buttonDisplay")) {
			System.exit(1);
		}
	}
	
	
	/*
	 * 	private LeftDisplay leftDisplay;
	private RightDisplay rightDisplay;
	
	public ParentDisplay() {
		setLayout(new BorderLayout());
	
		leftDisplay = new LeftDisplay();
		rightDisplay = new RightDisplay();
		
		separatorEast.setBackground(Color.DARK_GRAY);
		add(separatorEast, BorderLayout.EAST);
		
		separatorWest.setBackground(Color.DARK_GRAY);
		add(separatorWest, BorderLayout.WEST);
		
		separatorNorth.setBackground(Color.DARK_GRAY);
		add(separatorNorth, BorderLayout.NORTH);
		
		separatorSouth.setBackground(Color.DARK_GRAY);
		add(separatorSouth, BorderLayout.SOUTH);
		
		childDisplay.setLayout(new GridLayout(1, 3, 8, 0));
		
	//	leftDisplay.setBackground(Color.PINK);
		leftDisplay.setLayout(new BorderLayout());
		separatorLeft.setBackground(Color.DARK_GRAY);
		leftDisplay.add(separatorLeft, BorderLayout.EAST);
		childDisplay.add(leftDisplay);
				
	//	rightDisplay.setBackground(Color.GRAY);
		rightDisplay.setLayout(new BorderLayout());
		separatorRight.setBackground(Color.DARK_GRAY);
		rightDisplay.add(separatorRight, BorderLayout.WEST);
		childDisplay.add(rightDisplay);
		
		add(childDisplay, BorderLayout.CENTER);
	}

	@Override
	public void setLeftDisplay(LeftDisplay _leftDisplay) {
		// TODO Auto-generated method stub
		this.leftDisplay = _leftDisplay;
	}

	@Override
	public void setRightDisplay(RightDisplay _rightDisplay) {
		// TODO Auto-generated method stub
		this.rightDisplay = _rightDisplay;
	}
	 */
}
